<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <h1>Hello world!</h1>

  <script src="https://unpkg.com/socket.io-client@2.0.3/dist/socket.io.slim.js"></script>
  <script>
    const socket = new io(window.location.href, {
      path: '/custompath'
    });

    socket.on('connect', () => {
      document.querySelector('h1').innerText = 'Connected!';
    });
    socket.on('message', (data) => {
      document.querySelector('h1').innerText = data;
    });
  </script>
</body>
</html>
